<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="consignum" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
<head>
<consignum:cssDefault />
<consignum:jsDefault />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>:: GL - Gerenciador de Layout ::</title>
<script>
	jQuery(document).ready(function() {
		$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
			_title : function(title) {
				if (!this.options.title) {
					title.html("&#160;");
				} else {
					title.html(this.options.title);
				}
			}
		}));
		// Dialog click
		$('#buttonDialogSessaoExpirada').click(function() {
			$('#dialogSessaoExpirada').dialog('open');
			return false;
	
		});
	
		$('#dialogSessaoExpirada').dialog({
			autoOpen : false,
			width : 600,
			resizable : false,
			modal : true,
			title : "<div class='widget-header'><h4><i class='fa fa-warning'></i>Informação</h4></div>",
			buttons : [{
				html : "<i class='${icon}'></i>&nbsp; OK",
				"id" : "idButtonConfirmar",
				"class" : "btn bg-color-blueDark txt-color-white",
				click : function() {
					$("#formSessaoExpirada").attr("action", '/gl?c=8f14e45fceea167a5a36dedd4bea2543');
					$( "#formSessaoExpirada" ).submit();
					$(this).dialog("close");
				}
			}]
		});
		$( ".ui-dialog-titlebar-close").remove();
	});
</script>
</head>
<body class="animated fadeInDown">

	<c:if test='${empty requestScope.sessaoExpirada}'>
	<header id="header">

		<div id="logo-group">
			<span id="logo"> <img src="/gl/resources/img/logo.png" alt="GL">
			</span>
		</div>

	</header>

	<div id="main" style="margin-left: 51px;">

		<!-- MAIN CONTENT -->
		<div id="content" class="container">

			<div class="row">
				<div class="col-xs-12 col-sm-12 col-md-7 col-lg-8 hidden-xs hidden-sm">
					<h1 class="txt-color-red login-header-big">GL - Gerenciador de Layout</h1>
					<div class="hero">

					</div>

					<div class="row">
						<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
							<h5 class="about-heading">About SmartAdmin - Are you up to date?</h5>
							<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa.</p>
						</div>
						<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
							<h5 class="about-heading">Not just your average template!</h5>
							<p>Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi voluptatem accusantium!</p>
						</div>
					</div>

				</div>
				<div class="col-xs-12 col-sm-12 col-md-5 col-lg-4">
					<div class="well no-padding">
						<form action="j_security_check" method="post" id="login-form" name="login-form" class="smart-form client-form">
							<consignum:param id="controleLogin" value="controleLogin" />
							<header> Entre com suas informações</header>
							<consignum:messages id="msgGlobalValidacao" message="Login ou Senha inválida!" rendered="${not empty loginInvalido}" type="error" />
							<fieldset>

								<section>
									<c:if test="${ empty loginInvalido}">
										<label class="label">Login</label> <label class="input"> <i class="icon-append fa fa-user"></i> 
											<input type="text" id="j_username" name="j_username"> 
											<b class="tooltip tooltip-top-right"><i class="fa fa-user txt-color-white"></i>&nbsp;Por Favor informe seu login</b>
										</label>
									</c:if>
									<c:if test="${not empty loginInvalido}">
									  <label class="label">Login</label> <label class="input state-error"> <i class="icon-append fa fa-user"></i> 
										<input type="text" id="j_username" name="j_username" > 
										<b class="tooltip tooltip-top-right"><i class="fa fa-user txt-color-white"></i>&nbsp;Por Favor informe seu login</b>
									</label>
									</c:if>
								</section>

								<section>
									<c:if test="${empty loginInvalido}">
										<label class="label">Senha</label> <label class="input"> <i class="icon-append fa fa-lock"></i> <input type="password" id="j_password" name="j_password"> <b
											class="tooltip tooltip-top-right"><i class="fa fa-lock txt-color-white"></i>&nbsp; Entre com sua senha</b>
										</label>
									</c:if>
									<c:if test="${not empty loginInvalido}">
											<label class="label">Senha</label> 
											<label class="input state-error"> <i class="icon-append fa fa-lock"></i> 
											<input type="password" id="j_password" name="j_password"> <b
											class="tooltip tooltip-top-right"><i class="fa fa-lock txt-color-white"></i>&nbsp; Entre com sua senha</b>
										</label>
									</c:if>
									
									<div class="note">
										<a href="forgotpassword.html">Esqueci minha senha ?</a>
									</div>
									
								</section>
							</fieldset>
							<footer>
								<button type="submit" class="btn btn-primary">
									<i class="fa fa-check txt-color-white"></i>&nbsp; Confirmar
								</button>
							</footer>
						</form>
					</div>

				</div>
			</div>
		</div>
	</div>
	</c:if>
	
	<c:if test='${not empty requestScope.sessaoExpirada}'>
	 <form action="j_security_check" method="post" id="formSessaoExpirada" name="formSessaoExpirada" class="smart-form client-form">
	   <a href="#" id="buttonDialogSessaoExpirada"> Sessão Encerrada</a>
		<div id="dialogSessaoExpirada">
				<p> Sessão Encerrada!</p>
		 </div>
		<script>
		    $( document ).ready(function() {
			  $( "#buttonDialogSessaoExpirada" ).trigger( "click" );
			});
		</script>
		
		</form>
	</c:if>
	

	
</body>
</html>
